import pandas as pd
from cot_utils import generate_cot
# 读取原始数据
raw_path = 'data/SMSSpamCollection'
df = pd.read_csv(raw_path, sep='\t', header=None, names=['label', 'text'])

# 生成思维链提示
print('正在生成思维链提示...')
df['cot'] = df.apply(lambda row: generate_cot(row['text'], row['label']), axis=1)

# 显示基本信息
df.info()
print(df.head())

# 保存为CSV格式
df.to_csv('data/sms_spam_cot.csv', index=False)
print('已保存为 data/sms_spam_cot.csv')